package com.edt.ichannel.api.service.impl;

import com.edt.ichannel.api.dao.ExpansionDao;
import com.edt.ichannel.api.entiy.local.Expansion;
import com.edt.ichannel.api.service.ExpansionService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ExpansionServiceImpl implements ExpansionService {
    private Logger logger = LogManager.getLogger(ExpansionServiceImpl.class);
    @Resource
    private ExpansionDao expansionDao;



    @Override
    @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
    public void addExpansionCountMoney(double commissionMoney, String id) {
        expansionDao.addExpansionCountMoney(commissionMoney,id);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
    public void minusExpansionCountMoney(double commissionMoney, String id) {
        expansionDao.minusExpansionCountMoney(commissionMoney, id);
    }


    @Override
    public Expansion getExpansionById(String expansionId) {
        return expansionDao.getExpansionById(expansionId);
    }

    @Override
    public List<Expansion> getExpansionList(String dataStr) {
        return expansionDao.getExpansionList(dataStr);
    }


}
